package kr.hkit.powerjava.chapter14.windowbuilder;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;

public class BorderLayoutWin extends JFrame {

	private JPanel contentPane;
	private JButton btnPageStart;
	private JButton btnPageEnd;
	private JButton btnLineStart;
	private JButton btnCenter;
	private JButton btnLineEnd1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					BorderLayoutWin frame = new BorderLayoutWin();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public BorderLayoutWin() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(30, 30));
		setContentPane(contentPane);
		
		btnPageStart = new JButton("PageStart");
		contentPane.add(btnPageStart, BorderLayout.NORTH);
		
		btnPageEnd = new JButton("PageEnd");
		contentPane.add(btnPageEnd, BorderLayout.SOUTH);
		
		btnLineStart = new JButton("LineStart");
		contentPane.add(btnLineStart, BorderLayout.WEST);
		
		btnCenter = new JButton("Center");
		contentPane.add(btnCenter, BorderLayout.CENTER);
		
		btnLineEnd1 = new JButton("LineEnd");
		contentPane.add(btnLineEnd1, BorderLayout.EAST);
	}

}
